<?php

class Products extends Controller {

	function Products()
	{
		parent::Controller();	
	}
	
	function index($id)
	{
		$data = array();
		
		$data 				= $this->product->get_list_cat();
		$product 			= $this->product->get_product($id);
		
		if ($product['id']>0)
		{
			$data['products']		= $this->product->get_other_products($product['id'], $product['CategoryID']);
			
			$data['product_name']	= $product['Name'];
			$data['product_image']	= get_med_name($product['Image']);
			$data['image_orig']		= $product['Image'];
			$data['product_desc']	= $product['Description'];
			$data['product_body']	= $product['Body'];
		}
		unset($product);
		
		
		
		
		$page 				= $this->page->get_page($this->config->item('product_id', 'settings'));
		$data['title'] 		= $page['Name'];
		$data['flash'] 		= $page['Flash'];
		$data['flash_name'] = str_replace('.swf', '', $page['Flash']);
		unset($page);
		
		return $data;
	}
	
	function cat($id)
	{
		$data = array();
		
		$data 				= $this->product->get_list_cat();
		$data['products']	= $this->product->get_products($id);
		
		$page 				= $this->page->get_page($this->config->item('product_id', 'settings'));
		$data['title'] 		= $page['Name'];
		$data['flash'] 		= $page['Flash'];
		$data['flash_name'] = str_replace('.swf', '', $page['Flash']);
		unset($page);
		
		return $data;
	}

}

/* End of file products.php */
/* Location: ./system/application/modules/front/controllers/products.php */